package lianxi3;

public class Circle extends Shape{
    private double radius;

    public Circle() {

    }
    public Circle(String color, double radius) {
        super(color);
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return Math.PI*radius*radius;
    }

    @Override
    public double getPer() {
        return 2*Math.PI*radius;
    }

    @Override
    public void showAll() {
        System.out.println("该圆的颜色为："+getColor()+"，面积为："+getArea()+"，周长为："+getPer());
    }
}
